export default function(){
  const isLogin = wx.getStorageSync("cookie")
  if (!isLogin) {
    wx.showModal({
      title: '请先进行登录',
      content: '该功能需要登录以后才能使用',
      cancelText: "回到首页",
      confirmText: "去登录",
      success(e) {
        if (e.confirm) {
          wx.navigateTo({
            url: "../login/login"
          })
        } else {
          wx.switchTab({
            url: "../index/index"
          })
        }
      }
    })
    return false
  }
  return true
}